using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows;

namespace MinoChat.Converters;

public class MessageBackgroundConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is bool isUserMessage)
        {
            if (isUserMessage)
            {
                // 用户消息使用优雅的纯色背景
                return new SolidColorBrush(Color.FromRgb(0xF0, 0xF4, 0xFF)); // 极淡的蓝色
            }
            else
            {
                // AI消息使用浅灰色背景
                return new SolidColorBrush(Color.FromRgb(0xF5, 0xF5, 0xF5));
            }
        }

        return new SolidColorBrush(Colors.Gray);
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}